<template>
	<view class="content">
		<view class="vm-chunk" v-for="(item,index) in dataList" :key="index">
			<view class="vm-chunk-title">{{item.code}}</view>
			<view class="vm-chunk-content">
				<uni-list class="vm-chunk-content-list" :border="false">
					<uni-list-item title="设备名称" :rightText="iten.name"></uni-list-item>
					<uni-list-item title="所属系统" :rightText="iten.system"></uni-list-item>
					<uni-list-item title="所属位置" rightText="主馆-1F-1号门"></uni-list-item>
					<uni-list-item title="通道名称" rightText="102-1	F1号出口西"></uni-list-item>
				</uni-list>
				<view class="vm-chunk-content-operate">
					 <button class="vm-chunk-content-operate-button" @click="viewCli(item,'sb')">设备详情</button>
					 <button class="vm-chunk-content-operate-button" @click="viewCli(item,'xc')">巡查详情</button>
					 <button class="vm-chunk-content-operate-button" @click="viewCli(item,'by')">保养记录</button>
					 <button class="vm-chunk-content-operate-button" @click="viewCli(item,'wx')">维修记录</button>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {getRegeionDetails} from '../../../api/device/device.js'
  export default {
	  data(){
		  return{
			  dataList:[]
		  }
	  },
    onLoad(e) {
    	this.findListFu(e.id)
    },
	methods:{
		findListFu(id){
			getRegeionDetails().then(res=>{
				if(res.code===200){
					this.dataList=res.data
				}
			})
		},
		viewCli(item,e) {
			 if(e==="sb"){
				this.$tab.navigateTo('/pages/business/equipmentManagement/equipmentDetails?id='+item.id)
			 }else if(e==="xc"){
				this.$tab.navigateTo('/pages/business/equipmentManagement/patrolDetails?id='+item.id)
			 }else if(e==="by"){
				this.$tab.navigateTo('/pages/business/equipmentManagement/manintainRecordBy?id='+item.id)
			 }else if(e==="wx"){
				this.$tab.navigateTo('/pages/business/equipmentManagement/manintainRecordWx?id='+item.id)
			 }
		}
	}
  }
</script>
<style lang="scss">
  .content {
	 padding: 0 3%;
	 box-sizing: border-box;
	  .vm-chunk{
		  width: 100%;
		  padding: 20rpx;
		  box-sizing: border-box;
		  border-radius: 18rpx;
		  margin-top: 20rpx;
		  background: linear-gradient(to bottom,#edf9ff 0%,#fff 20%);
		  &-title{
			  font-size: 34rpx;
			  color: #000;
			  font-weight: 500;
			  line-height: 80rpx;
			  height: 80rpx;
			  position: relative;
		  }
		  &-content{
			  &-list{
				  margin: 20rpx 0;
				  border-bottom:1px solid #e7f1fc;
			  }
			  &-operate{
				  width: 100%;
				  display: flex;
				  justify-content: space-between;
				  &-button{
					  height: 60rpx;
					  line-height: 60rpx;
					  font-size: 24rpx;
					  width: 25%;
					  background: #fff;
					  color: #016aed;
				  }
			  }
		  }
	  }
	uni-button:after{
		border: none;
	}
	/deep/ .uni-list--border:after{
		background-color: transparent;
	}
  }
</style>